package com.hust.bridgecheck.controller.UserManagement;


import com.hust.bridgecheck.entity.Domain;
import com.hust.bridgecheck.entity.UserGroup;
import com.hust.bridgecheck.service.UserManagement.DomainService;
import com.hust.bridgecheck.service.UserManagement.GroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("group")
public class GroupPageController {
    //加入group的一些操作
    @Autowired
    private GroupService groupService;
    @Autowired
    private DomainService domainService;
    @GetMapping("/manager")
    public String getAllGroup(Model model){
        List<UserGroup> g_lists = groupService.getAllGroup();
        List<Domain> d_lists = domainService.getAllDomain();
        model.addAttribute("group",g_lists);
        model.addAttribute("domain",d_lists);
        return "groupadd";
    }
}
